<template>
    <div class="comments">
       <Comment v-for="(item,index) in data" :key="index" :data="item" />
    </div>
    
</template>
<script>
import { getComment } from "@/request/api";
import Comment from '@/components/Comment'
export default {
    name : 'Comments',
    components:{
        Comment
    },
    props:{
        url:{
            type : String,
            default: ''
        }
    },
    data(){
        return{
            data:[]          
            
        }
    },
    created(){
       getComment(this.url).then((data)=>{
           this.data = data
       })
    }
}
</script>
<style scoped>
.comments{
    width: 100%;
    display: flex;
    flex-direction: column;
 }


</style>